Skip to main content
Version: Legacy SeeSo

API Docs

Overview

NametypeDescription
SeeSoclassThe main class for utilizing gaze tracking functionality within the seeso_flutter package.
GazeInfoclassA class representing gaze information obtained from a gaze event.
FaceInfoclassA class representing face information obtained from a face event.
StatusInfoclassA class representing status information obtained from a status event.
CalibrationInfoclassA class representing calibration information obtained from a calibration event.
UserStatusInfoclassA class representing user status information obtained from a user status event.
OneEuroFilterManagerclassManages a collection of OneEuroFilters for filtering multiple values.
InitializedResultclassRepresents the result of the SeeSo gaze tracker initialization.
CameraPosition classThis class represents the camera position for Android.
CalibrationModeenumAn enumeration representing the calibration modes for calibration processes.
CalibrationCriteriaenumAn enum representing different calibration criteria or levels.
TrackingStateenumEnum representing different states of gaze tracking.
ScreenStateenumAn enumeration representing different states of gaze position in relation to the device screen.
EyeMovementStateenumAn enumeration representing different types of eye movement states.
StatusTypeenumAn enumeration representing different types of status events for gaze tracking.
StatusErrorTypeenumAn enumeration representing different types of error scenarios when the gaze tracking status stops.
CalibrationTypeenumAn enumeration representing the different stages within a calibration process.
UserStatusEventTypeenumAn enumeration representing different types of user status events that can be tracked.
SeeSoOrientation enumAn enumeration representing different types of gaze events orientation that can be tracked.

SeeSo

class SeeSo

The SeeSo class provides methods and properties for initializing and managing gaze tracking capabilities on mobile devices.

Summary

Function
getSeeSoVersion
checkCameraPermission
requestCameraPermission
initGazeTracker
deinitGazeTracker
getGazeEvent
getFaceEvent
getStatusEvent
getCalibrationEvent
getUserStatusEvent
startTracking
stopTracking
isTracking
setTrackingFPS
startCalibration
stopCalibration
isCalibrating
startCollectSamples
setAttentionInterval
getAttentionScore
setAttentionRegion
getAttentionRegion
removeAttentionRegion
isDeveiceFound
addCameraPosition
getCameraPosition
getCameraPositionList
selectCameraPosition
setForcedOrientation
resetForcedOrientation

getSeeSoVersion

Future<String?> getSeeSoVersion()

Retrieves the version of SeeSo for the current platform.

Return TypeDescription
Future<String?>Returns a Future that completes with the version string or null if there is an issue retrieving the version.

Example

String? seesoVersion;
try {
seesoVersion = await _seesoPlugin.getSeeSoVersion();
} on PlatformException {
seesoVersion = 'Failed to get SeeSo version';
}

checkCameraPermission

Future<bool> checkCameraPermission() async

This function asynchronously checks whether the camera permission is granted for the SeeSo SDK.

Return TypeDescription
Future<bool>true if the camera permission is granted.

Example

_hasCameraPermission = await _seesoPlugin.checkCameraPermission();
if (!_hasCameraPermission) {
print("Camera permission not granted.")
}

requestCameraPermission

Future<bool> requestCameraPermission() async

Requests camera permission and returns whether the permission is granted.

This function asynchronously requests camera permission from the user.

Return TypeDescription
Future<bool>false if the user denies the camera permission or if the permission was previously denied.
note

If the user has previously denied camera permissions, calling this function will not prompt for camera permissions again.

Example

_hasCameraPermission = await _seesoPlugin.requestCameraPermission();

setState(() {
_hasCameraPermissionString = _hasCameraPermission ? "granted" : "denied";
});

initGazeTracker

FutureOr<InitializedResult?> initGazeTracker({
required String licenseKey,
bool useAttention = false,
bool useBlink = false,
bool useDrowsiness = false,
})

Initializes the SeeSo gaze tracker functionality.

note

You cannot use the functions related to SeeSo's gaze tracking until this function has been called.

This function initializes the SeeSo gaze tracker with the provided licenseKey and optional feature flags.

ParametersTypeDescription
licenseKeyStringThe licenseKey parameter is mandatory and should be obtained from manage.seeso.io for authentication. Without a valid license key, the initialization will fail.
useAttentionboolThe useAttention parameter, when set to true, enables the attention tracking feature, which monitors the user's focus on the screen.
useBlinkboolThe useBlink parameter, when set to true, enables the blink tracking feature, which detects when the user blinks their eyes.
useDrowsinessboolThe useDrowsiness parameter, when set to true, enables the drowsiness tracking feature, which detects when the user appears drowsy.

The function returns an [InitializedResult] object, which contains information about the success or failure of the initialization process.

Return TypeDescription
FutureOr<InitializedResult?>If the initialization is successful, [result] in theInitializedResult object will be true, and message will be "ERROR_NONE." If the initialization fails, result will be false, and message will provide details about the failure.
note

If an error occurs during the initialization process, such as a missing or invalid license key, result will be null in the InitializedResult object.

Example

String requestInitGazeTracker = "failed Request";
if (_hasCameraPermission) {
try {
InitializedResult? initializedResult =
await _seesoPlugin.initGazeTracker(licenseKey: _licenseKey); // not use attention, blink, drowsiness
if (initializedResult!.result) {
print("initialized success!.");
} else if (initializedResult!.result == false) {
print("initialized failed! reason : ${initializedResult!.message}");
} else {
print("Occur PlatformException");
}
} on PlatformException catch (e) {
print("Occur PlatformException (${e.message})");
}
}

deinitGazeTracker

Future<void> deinitGazeTracker() async

Deinitializes the SeeSo gaze tracker functionality.

This function is used to gracefully shut down and release resources related to the SeeSo. After calling this function, other SeeSo-related features cannot be used.

Example

await _seesoPlugin.deinitGazeTracker();
print("seeso deinit!");
_seesoPlugin = null;

getGazeEvent

Stream<dynamic> getGazeEvent()

Retrieves a stream of gaze events for gaze tracking information.

This function returns a stream that provides gaze-related information through GazeEvent objects. Consumers of the stream can receive and process updates about gaze tracking data.

note

Using the event object received during listen by passing it into GazeInfo makes it easier to handle.

Example

_seesoPlugin.getGazeEvent().listen((event) {
GazeInfo info = GazeInfo(event);

if (info.trackingState == TrackingState.SUCCESS) {
setState(() {
_x = info.x;
_y = info.y;
_gazeColor = Colors.green;
});
} else {
setState(() {
_gazeColor = Colors.red;
});
}
});

getFaceEvent

Stream<dynamic> getFaceEvent()

Retrieves a stream of face events for facial information.

This function returns a stream that provides facial information through FaceEvent objects. Consumers of the stream can receive and process updates about facial data.

note

Using the event object received during listen by passing it into FaceInfo makes it easier to handle.

Example

_seesoPlugin.getFaceEvent().listen((event) {
FaceInfo info = FaceInfo(event);
print("face in degree pitch(${info.pitch}), yaw(${info.yaw}), roll(${info.roll})")
});

getStatusEvent

Stream<dynamic> getStatusEvent()

Retrieves a stream of status events for tracking status information.

This function returns a stream that provides status information about whether SeeSo has started or stopped gaze tracking through StatusEvent objects. Consumers of the stream can receive and process updates about tracking status.

note

Using the event object received during listen by passing it into StatusInfo makes it easier to handle.

Example

_seesoPlugin.getStatusEvent().listen((event) {
StatusInfo statusInfo = StatusInfo(event);
if (statusInfo.type == StatusType.START) {
setState(() {
_stateString = "start Tracking";
});
} else {
setState(() {
_stateString = "stop Trakcing : ${statusInfo.stateErrorType}";
});
}
});

getCalibrationEvent

Stream<dynamic> getCalibrationEvent()

Retrieves a stream of calibration events for calibration information.

This function returns a stream that provides calibration information through CalibrationEvent objects. Consumers of the stream can receive and process updates about calibration data.

note

Using the event object received during listen by passing it into CalibrationInfo makes it easier to handle.

Example

 _seesoPlugin.getCalibrationEvent().listen((event) {
CalibrationInfo caliInfo = CalibrationInfo(event);
if (caliInfo.type == CalibrationType.CALIBRATION_NEXT_XY) {
setState(() {
_nextX = caliInfo.nextX!;
_nextY = caliInfo.nextY!;
_calibrationProgress = 0.0;
});
Future.delayed(const Duration(milliseconds: 500), () {
_seesoPlugin.startCollectSamples();
});
} else if (caliInfo.type == CalibrationType.CALIBRATION_PROGRESS) {
setState(() {
_calibrationProgress = caliInfo.progress!;
});
} else if (caliInfo.type == CalibrationType.CALIBRATION_FINISHED) {
setState(() {
_isCaliMode = false;
});
}
});

getUserStatusEvent

Stream<dynamic> getUserStatusEvent()

Retrieves a stream of user status events for attention, blink, and drowsiness information.

This function returns a stream that provides user status information, including attention, blink, and drowsiness events, through UserStatusEvent objects. Consumers of the stream can receive and process updates about these user status events.

note

Using the event object received during listen by passing it into UserStatusInfo makes it easier to handle.

Example

_seeso.getUserStatusEvent().listen((event) {
UserStatusInfo userStatusInfo = UserStatusInfo(event);
if (userStatusInfo.type == UserStatusEventType.ATTENTION) {
attentionInfo = userStatusInfo;
} else if (userStatusInfo.type == UserStatusEventType.BLINK) {
blinkInfo = userStatusInfo;
} else {
drowsinessInfo = userStatusInfo;
}
});

startTracking

Future<void> startTracking() async

Starts the gaze tracking process.

Initiates the process of tracking the user's gaze. Prior to calling this function, make sure to have initialized the gaze tracker using the initGazeTracker function.

note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, PlatformException may be thrown.

Example

try {
await _seeso.startTracking();
} on PlatformException catch(e) {
print("failed seeso's startTracking call : ${e.message}");
}

stopTracking

Future<void> stopTracking() async

Stops the ongoing gaze tracking process.

Use this function to halt the gaze tracking operation. Before calling this function, ensure that you have initialized the gaze tracker using the initGazeTracker function.

note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

try {
await _seeso.stopTracking();
} on PlatformException catch(e) {
print("failed seeso's stopTracking call : ${e.message}");
}

isTracking

Future<bool?> isTracking() async

Checks whether gaze tracking is currently in progress.

Use this function to determine if the gaze tracking process is active. Before calling this function, make sure you have initialized the gaze tracker using the initGazeTracker function.

Return TypeDescription
Futrue<bool?>false if gaze tracking is not active or if gaze tracking has not been properly initialized.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

try {
bool? isTracking = await _seeso.isTracking();
if (isTracking != null) {
print("failed seeso's isTracking ${isTracking}");
} else {
print("failed seeso's isTracking call");
}
} on PlatformException catch(e) {
print("failed seeso's isTracking call : ${e.message}");
}

setTrackingFPS

Future<bool?> setTrackingFPS(int fps) async

Sets the frames per second (FPS) for gaze tracking in the SeeSo SDK.

Use this function to specify the desired FPS for gaze tracking in the SeeSo SDK. The FPS value can range from 1 to 30, with the default FPS being 30 for the front camera.

ParametersTypeDescription
fpsintThe desired frames per second for gaze tracking.
Return TypeDescription
Future<bool?>false if the FPS value is out of range (below 1 or above 30) or if an error occurs.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

try {
bool? isResult = await _seeso.setTrackingFPS(15);
if (isResult != null) {
print("seeso's setTrackingFPS result ${isResult}");
} else {
print("failed seeso's setTrackingFPS call");
}
} on PlatformException catch(e) {
print("failed seeso's setTrackingFPS call : ${e.message}");
}

startCalibration

 Future<void> startCalibration(CalibrationMode calibrationMode,
{CalibrationCriteria calibrationCriteria = CalibrationCriteria.DEFAULT,
Rect? region}) async

Starts the calibration process in the SeeSo SDK.

Use this function to initiate the calibration process in the SeeSo SDK.

ParametersTypeDescription
calibrationModeCalibrationModeThe calibration mode to be used. Choose from modes 1, 5, and 6 which display different numbers of calibration targets.
calibrationCriteriaCalibrationCriteriaThe calibration criteria to be used. If not specified, the default criteria will be used.
regionRect?The region of the device screen where calibration targets will be displayed. If not specified, the calibration targets will be shown on the entire screen.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

try {
await _seeso.startCalibration(calibrationMode);
print("Start Calibration!");
} on PlatformException catch (e) {
print("failed seeso's startCalibration call : ${e.message}");
}

stopCalibration

Future<void> stopCalibration() async

Stops the ongoing calibration process in the SeeSo SDK.

Use this function to interrupt the ongoing calibration process in the SeeSo SDK. Any progress made before stopping will not be applied.

note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

try {
_seeso.stopCalibration();
isCalibrating = false;
} on PlatformException catch (e) {
print("failed seeso's stopCalibration call : ${e.message}");
}

isCalibrating

Future<bool?> isCalibrating() async

Checks whether the SeeSo SDK is currently in the process of calibration.

Use this function to determine if the SeeSo SDK is currently performing a calibration process.

Return TypeDescription
Future<bool?>false if the SDK is not calibrating or if an error occurs during the process.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

try {
await _seeso.startCalibration(calibrationMode);
bool? isCalibrating = await _seeso.isCalibrating();
if (isCalibrating != null && isCalibrating == true) {
print("Start Calibration!");
}
} on PlatformException catch (e) {
print("failed seeso's startCalibration call : ${e.message}");
}

startCollectSamples

Future<void> startCollectSamples() async 

Notifies the SeeSo SDK to begin collecting samples for the current calibration target.

Use this function to inform the SeeSo SDK that you have displayed the calibration target point on the UI, and you are ready to start collecting calibration data for that target.

note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

_seeso.getCalibrationEvent().listen((event) {
CalibrationInfo calibrationInfo = CalibrationInfo(event);
if (calibrationInfo.type == CalibrationType.CALIBRATION_NEXT_XY) {
if (calibrationInfo.nextX != null && calibrationInfo.nextY != null) {
nextPoint = Point(calibrationInfo.nextX!, calibrationInfo.nextY!);
progress = 0;
try {
_seeso.startCollectSamples();
} on PlatformException catch (e) {
print("failed seeso's startCollectSamples call : ${e.message}");
}
}
}
});

setCalibrationData

Future<bool?> setCalibrationData(List<double> data) async

Sets the calibration data to the SeeSo SDK for calibration refinement.

Use this function to provide the SeeSo SDK with previously collected calibration data for calibration refinement or adjustment.

ParametersTypeDescription
dataList<double>The data parameter should be a list of doubles containing the calibration data.
Return TypeDescription
Future<bool?>true if the calibration data is successfully set. false if the calibration data setting fails.null if an error occurs during the data setting process.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

_seeso.getCalibrationEvent().listen((event) {
CalibrationInfo calibrationInfo = CalibrationInfo(event);
if (calibrationInfo.type == CalibrationType.CALIBRATION_FINISHED) {
calibrationData = calibrationInfo.calibrationData
isCalibrating = false;
}
});

void loadCalibrationData() async {
try {
_seeso.setCalibrationData(calibrationData);
} on PlatformException catch (e) {
print("failed seeso's startCollectSamples call : ${e.message}");
}
}


setAttentionInterval

Future<void> setAttentionInterval(int interval) async

Sets the interval for receiving Attention-related events in the SeeSo SDK's UserStatusEvent.

Use this function to adjust the frequency at which Attention-related events are received in the UserStatusEvent stream from the SeeSo SDK.

ParametersTypeDescription
intervalintThe interval parameter determines the time interval, in seconds, between each received Attention event. The default interval is 30 seconds, and it can be set between 10 to 60 seconds.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

try {
// I will receive attention-related information every 10 seconds.
_seeso.setAttentionInterval(10);
} on PlatformException catch (e) {
print("failed seeso's setAttentionInterval call : ${e.message}");
}

getAttentionScore

Future<double?> getAttentionScore() async

Retrieves the current Attention score from the SeeSo SDK.

Use this function to get the current Attention score from the SeeSo SDK.

Return TypeDescription
Future<double>?The returned value is a double between 0 and 1, representing the user's attention level.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

try {
double? currentScore = _seeso.getAttentionScore();
if (currentScore != null) {
print("current attention score : ${currentScore}");
}
} on PlatformException catch (e) {
print("failed seeso's getAttentionScore call : ${e.message}");
}

setAttentionRegion

Future<void> setAttentionRegion(Rect region) async

Sets the region of interest (ROI) for the Attention feature in the SeeSo SDK.

Use this function to set the region of interest (ROI) for the Attention feature in the SeeSo SDK.

ParametersTypeDescription
regionRectThe region parameter should be a Rect object representing the area of interest on the camera view.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Example

try {
// roi is x : 10, y : 10, width : 100, height : 100
Rect roi = Rect(10, 10, 100, 100);
_seeso.setAttentionRegion(roi);
} on PlatformException catch (e) {
print("failed seeso's setAttentionRegion call : ${e.message}");
}

getAttentionRegion

Future<Rect?> getAttentionRegion() async

Retrieves the currently set region of interest (ROI) for the Attention feature in the SeeSo SDK.

Use this function to get the currently set region of interest (ROI) for the Attention feature in the SeeSo SDK. The returned Rect object represents the area of interest on the view.

Return TypeDescription
Future<Rect?>The currently set region of interest (ROI) for the Attention feature, or null if not available.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Examples

try {
Rect? roi = await _seeso.getAttentionRegion();
if (roi != null) {
print("current roi is ${roi.toString()}");
}
} on PlatformException catch (e) {
print("failed seeso's setAttentionRegion call : ${e.message}");
}

removeAttentionRegion

Future<void> removeAttentionRegion() async

Removes the currently set region of interest (ROI) for the Attention feature in the SeeSo SDK.

Use this function to remove the currently set region of interest (ROI) for the Attention feature in the SeeSo SDK. After removal, attention-related information will not be provided.

note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown.

Examples

try {
Rect? roi = await _seeso.getAttentionRegion();
if (roi != null) {
await _seeso.removeAttentionRegion();
print("removed attention region");
}
} on PlatformException catch (e) {
print("failed seeso's setAttentionRegion or removeAttentionRegion call : ${e.message}");
}

isDeviceFound

Future<bool?> isDeviceFound() async

Checks whether the necessary device information is available for the SeeSo SDK.

Use this function to determine if the required device information is available for accurate functioning of the SeeSo SDK. It is important to have the correct device information to ensure optimal performance.

Return TypeDescription
Future<bool?>false if the necessary device information is not available or if the gaze tracker has not been properly initialized.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown. Additionally, this function is specific to Android, and if used on iOS, MissingPluginException may occur.

Example

try {
bool? isDeviceFound = await _seeso.isDeviceFound();
if (isDeviceFound != null) {
print("failed seeso's isDeviceFound ${isDeviceFound}");
} else {
print("failed seeso's isDeviceFound call");
}
} on PlatformException catch(e) {
print("failed seeso's isDeviceFound call : ${e.message}");
} on MissingPluginException catch(e) {
print("current platform is iOS ${e.message}");
}

addCameraPosition

Future<void> addCameraPosition(CameraPosition cameraPosition) async

Adds the camera position information for the SeeSo SDK.

Use this function to provide the SeeSo SDK with the necessary camera position information to improve the accuracy of gaze tracking. The cameraPosition parameter should contain the relevant camera position data.

ParametersTypeDescrption
cameraPositionCameraPositionThe camera position information to be added for the SeeSo SDK.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown. Additionally, This function is specific to Android. If used on iOS, a MissingPluginException.

Example

try {
CameraPosition cameraPosition = CameraPosition(
modelName: "test",
screenWidth: 1080,
screenHeight: 720,
screenOriginX: -30,
screenOriginY: 5);
await _seeso.addCameraPosition(cameraPosition);
} on PlatformException catch(e) {
print("failed seeso's addCameraPosition call : ${e.message}");
} on MissingPluginException catch(e) {
print("current platform is iOS ${e.message}");
}

getCameraPosition

Future<CameraPosition?> getCameraPosition()

Retrieves the current CameraPosition used by the SeeSo SDK.

Use this function to get the camera position information that is currently being used by the SeeSo SDK.

Return TypeDescription
Future<CameraPosition?>currently being used by the SeeSo SDK.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown. Additionally, This function is specific to Android. If used on iOS, a MissingPluginException.

Example

try {
CameraPosition? cameraPosition = await _seeso.getCameraPosition();
if (cameraPositon != null) {
print("current cameraPosition : ${cameraPosition!.modelName}");
} else {
print("seeso's getCameraPosition is null");
}
} on PlatformException catch(e) {
print("failed seeso's getCameraPosition call : ${e.message}");
} on MissingPluginException catch(e) {
print("current platform is iOS ${e.message}");
}

getCameraPositionList

Future<List<CameraPosition>?> getCameraPositionList() async

Retrieves the list of current CameraPosition used by the SeeSo SDK.

Use this function to get a list of camera position information that is currently being used by the SeeSo SDK. The returned list contains CameraPosition objects, each representing a different camera position.

Return TypeDescription
Future<List<CameraPosition>?>The CameraPosition currently being used by the SeeSo SDK, or null if not available.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown. Additionally, This function is specific to Android. If used on iOS, a MissingPluginException.

Example

try {
List<CameraPosition>? cameraPositions = await _seeso.getCameraPositionList();
if (cameraPositions != null) {
for(CameraPosition cp : cameraPositions) {
print("CameraPosition : ${cp.modelName}");
}
} else {
print("seeso's getCameraPositionList is null");
}
} on PlatformException catch(e) {
print("failed seeso's getCameraPositionList call : ${e.message}");
} on MissingPluginException catch(e) {
print("current platform is iOS ${e.message}");
}

selectCameraPosition

Future<void> selectCameraPosition(int idx) async

Selects a specific camera position from the list of available camera positions in the SeeSo SDK.

Use this function to choose a camera position from the list of available camera positions in the SeeSo SDK by providing its idx value.

ParametersTypeDescription
idxintThe index of the camera position to be selected.
note

If the camera permission is not granted or if the gaze tracker has not been properly initialized, a PlatformException may be thrown. Additionally, This function is specific to Android. If used on iOS, a MissingPluginException.

Example

try {
List<CameraPosition>? cameraPositions = await _seeso.getCameraPositionList();
if (cameraPositions != null && cameraPositions.length > 1) {
await _seeso.selectCameraPosition(2);
} else {
print("seeso's getCameraPositionList is null");
}
} on PlatformException catch(e) {
print("failed seeso's getCameraPositionList or selectCameraPosition call : ${e.message}");
} on MissingPluginException catch(e) {
print("current platform is iOS ${e.message}");
}

setForcedOrientation

Future<bool?> setForcedOrientation(SeeSoOrientation orientation) async

Forces a manual orientation change for the device in the SeeSo SDK.

Use this function to manually change the orientation of the device in the SeeSo SDK.

ParametersTypeDescription
orientationSeeSoOrientationThe orientation parameter specifies the desired orientation using the SeeSoOrientation enum.
Return TypeDescription
Future<bool?>true if the orientation change was successful. false if the orientation change failed or if the feature is not supported. null if an error occurs during the process.
note

Before calling this function, ensure that the gaze tracker has been properly initialized and that camera permission is granted. Otherwise, a PlatformException may be thrown. Additionally, please be aware that this function is specific to iOS. If used on Android, a MissingPluginException may occur.

Example

try {
// set landscpe_left orientation.
bool? result = await _seeso.setForcedOrientation(SeeSoOrientation.LANDSCAPE_LEFT);
if (result != null && result == true) {
print("changed.")
} else {
print("seeso's setForcedOrientation is fail");
}
} on PlatformException catch(e) {
print("failed seeso's setForcedOrientation call : ${e.message}");
} on MissingPluginException catch(e) {
print("current platform is Android ${e.message}");
}

resetForcedOrientation

Future<bool?> resetForcedOrientation() async

Resets the previously forced orientation for the device in the SeeSo SDK.

Use this function to reset the previously set forced orientation for the device in the SeeSo SDK. After calling this function, the device's orientation will be set automatically.

Return TypeDescription
Future<bool?>true if the reset of forced orientation was successful. false if the reset failed or if the feature is not supported. null if an error occurs during the process.
note

Before calling this function, ensure that the gaze tracker has been properly initialized and that camera permission is granted. Otherwise, a PlatformException may be thrown. Additionally, please be aware that this function is specific to iOS. If used on Android, a MissingPluginException may occur.

Example

try {
// set landscpe_left orientation.
bool? result = await _seeso.setForcedOrientation(SeeSoOrientation.LANDSCAPE_LEFT);
if (result != null && result == true) {
print("changed.")
} else {
print("seeso's setForcedOrientation is fail");
}
// after 500ms, reset forced orientation.
Timer(const Duration(milliseconds: 500), () {
_seeso.resetFocedOrientation();
});

} on PlatformException catch(e) {
print("failed seeso's setForcedOrientation call : ${e.message}");
} on MissingPluginException catch(e) {
print("current platform is Android ${e.message}");
}


GazeInfo

class GazeInfo

A class representing gaze information obtained from a gaze event.

Summary

VariableTypeDescription
timestampintThe timestamp in milliseconds when the gaze event occurred.
xdoubleThe X-coordinate of the gaze position on the screen in pixels.
ydoubleThe Y-coordinate of the gaze position on the screen in pixels.
fixationXdoubleThe X-coordinate of the last fixation position on the screen in pixels.
fixationYdoubleThe Y-coordinate of the last fixation position on the screen in pixels.
leftOpennessdoubleThe degree of openness of the left eye (applicable when blink detection is enabled).
rightOpennessdoubleThe degree of openness of the right eye (applicable when blink detection is enabled).
trackingStateTrackingStateThe state of gaze tracking.
eyeMovementStateEyeMovementStateThe state of eye movement.
screenStateScreenStateThe state of gaze position in relation to the screen.
Function
Constructor
setGaze
setFixationGaze

Constructor

GazeInfo(Map<dynamic, dynamic> event) 

Creates a GazeInfo instance using the provided gaze event event. The event should contain all the necessary information for creating a GazeInfo object.

Map<dynamic, dynamic> event

Key (String)Value Type
TIMESTAMPint
Xdouble
Ydouble
FIXATION_Xdouble
FIXATION_Ydouble
LEFT_OPENNESSdouble
RIGHT_OPENNESSdouble
TRACKING_STATEString
EYE_MOVEMENT_STATEString
SCREEN_STATEString

Example

_seesoPlugin.getGazeEvent().listen((event) {
GazeInfo info = GazeInfo(event);
});

setGaze

void setGaze(double x, double y)

This is a function that modifies the x and y values of GazeInfo

Parameterstypedescription
xdoubleThe X-coordinate of the gaze position on the screen in pixels.
ydoubleThe Y-coordinate of the gaze position on the screen in pixels.

Example

_seeso.getGazeEvent().listen((event) {
GazeInfo gazeInfo = GazeInfo(event);
this.gazeInfo = gazeInfo;
bool isFiltered = _filterManager
.filterValues(gazeInfo.timestamp, [gazeInfo.x, gazeInfo.y]);
if (isFiltered) {
// changed filterd gaze x, y;
this.gazeInfo?.setGaze(_filterManager.getFilteredValues()[0],
_filterManager.getFilteredValues()[1]);
}
});

setFixationGaze

void setFixationGaze(double fixationX, double fixationY)

This is a function that modifies the fixationX and fixationY values of GazeInfo

ParametersTypeDescription
fixationXdoubleThe X-coordinate of the last fixation position on the screen in pixels.
fixationYdoubleThe Y-coordinate of the last fixation position on the screen in pixels.

Example

_seeso.getGazeEvent().listen((event) {
GazeInfo gazeInfo = GazeInfo(event);
this.gazeInfo = gazeInfo;
bool isFiltered = _filterManager
.filterValues(gazeInfo.timestamp, [gazeInfo.fixationX, gazeInfo.fixationY]);
if (isFiltered) {
// changed filterd fixation x, y;
this.gazeInfo?.setFixationGaze(_filterManager.getFilteredValues()[0],
_filterManager.getFilteredValues()[1]);
}
});

FaceInfo

class FaceInfo

Creates a FaceInfo instance using the provided event data. The event should be a map containing raw data from a FaceEvent. This constructor converts the raw event data into a user-friendly object format.

Summary

VariableTypeDescription
timestampintThe timestamp when the facial information was captured.
scoredoubleThe confidence score of facial recognition (ranging from 0.0 to 1.0).
frameSizeSizeThe size of the frame containing the face in pixels.
rectRectThe rectangular region in which the face is located.
pitchdoubleThe pitch rotation of the face in degrees.
yawdoubleThe yaw rotation of the face in degrees.
rolldoubleThe roll rotation of the face in degrees.
centerXdoubleThe distance from the camera to the face's center along the X-axis in millimeters.
centerYdoubleThe distance from the camera to the face's center along the Y-axis in millimeters.
centerZdoubleThe distance from the camera to the face's center along the Z-axis in millimeters.
Function
Constructor

Constructor

FaceInfo(Map<dynamic, dynamic> event)

Creates a FaceInfo instance with the provided event data.

The event should be a map containing raw data from a FaceEvent. The constructor extracts and assigns the relevant data fields to the corresponding properties.

Map<dynamic, dynamic> event

Key (String)Value Type
TIMESTAMPint
SCOREdouble
FRAME_WIDTHdouble
FRAME_HEIGHTdouble
FIXATION_Ydouble
LEFTdouble
TOPdouble
RIGHTdouble
BOTTOMdouble
PITCHdouble
PITCHdouble
YAWdouble
ROLLdouble
CENTER_Xdouble
CENTER_Ydouble
CENTER_Zdouble

Example

_seesoPlugin.getFaceEvent().listen((event) {
FaceInfo info = FaceInfo(event);
});

StatusInfo

class StatusInfo

A class that represents information about status events, converting raw event data from a StatusEvent into a user-friendly object format.

Summary

VariableTypeDescription
typeStatusTypeThe type of the status event, indicating whether it's a start or stop event.
stateErrorTypeStatusErrorType?The type of error that occurred if the status event represents a stop event.
Function
Constructor

Constructor

StatusInfo(Map<dynamic, dynamic> event)

Creates a StatusInfo instance using the provided event data.

The event should be a map containing raw data from a StatusEvent. This constructor extracts and assigns the relevant data fields to the corresponding properties.

Map<dynamic, dynamic> event

Key (String)Value Type
STATUS_EVENT_TYPEString
STATUS_FAILED_REASONString

Example

_seeso.getStatusEvent().listen((event) {
StatusInfo statusInfo = StatusInfo(event);
if (statusInfo.type == StatusType.START) {
// todo start tracking state
} else {
// todo stop tracking state
}
});

CalibrationInfo

class CalibrationInfo

A class that represents information about calibration events, converting raw event data from a CalibrationEvent into a user-friendly object format.

Summary

VariableTypeDescription
typeCalibrationTypeThe type of the calibration event, indicating its purpose and meaning.
progressdouble?The progress value of the ongoing calibration, ranging from 0.0 to 1.0.
nextXdouble?The X-coordinate of the next calibration target when the type is CALIBRATION_NEXT_XY.
nextYdouble?The Y-coordinate of the next calibration target when the type is CALIBRATION_NEXT_XY.
progressList<double>?The calibration data values when the type is CALIBRATION_FINISHED.
Function
Constructor

Constructor

CalibrationInfo(Map<dynamic, dynamic> event)

Creates a CalibrationInfo instance using the provided event data.

The event should be a map containing raw data from a CalibrationEvent. This constructor extracts and assigns the relevant data fields to the corresponding properties.

Map<dynamic, dynamic> event

Key (String)Value Type
CALIBRATION_TYPEString
PROGRESSdouble
NEXT_Xdouble
NEXT_Ydouble
CALIBRATION_DATAList

Example

_seeso.getCalibrationEvent().listen((event) {
CalibrationInfo calibrationInfo = CalibrationInfo(event);
if (calibrationInfo.type == CalibrationType.CALIBRATION_NEXT_XY) {
// todo next tart setting
} else if (calibrationInfo.type == CalibrationType.CALIBRATION_PROGRESS) {
// todo current target progress
} else {
// todo calibration finished state
}
});

UserStatusInfo

class UserStatusInfo

A class that represents user status information events, converting raw event data from a UserStatusEvent into a user-friendly object format.

Summary

VariableTypeDescription
typeUserStatusEventTypeThe type of the user status event, indicating the specific type of tracking being performed.
timestampint?The timestamp when the user status event occurred.
timestampBeginint?The beginning timestamp of the event, in milliseconds, when applicable.
timestampEndint?The ending timestamp of the event, in milliseconds, when applicable.
attentionScoredouble?The attention score of the user, ranging from 0.0 to 1.0, when applicable.
isBlinkLeftbool?Indicates whether the left eye is blinked, when applicable.
isBlinkRightbool?Indicates whether the right eye is blinked, when applicable.
isBlinkbool?Indicates whether both eyes are blinked, when applicable.
leftOpennessdouble?The openness score of the left eye, ranging from 0.0 to 1.0, when applicable.
rightOpennessdouble?The openness score of the right eye, ranging from 0.0 to 1.0, when applicable.
isDrowsinessbool?Indicates whether drowsiness is detected, when applicable.
drowsinessIntensitydouble?The intensity of drowsiness, ranging from 0.0 to 1.0, when applicable.
Function
Constructor

Constructor

UserStatusInfo(Map<dynamic, dynamic> event) 

Creates a UserStatusInfo instance using the provided event data.

The event should be a map containing raw data from a UserStatusEvent. This constructor extracts and assigns the relevant data fields to the corresponding properties.

Map<dynamic, dynamic> event

Key (String)Value Type
USER_STATUS_EVENT_TYPEString
USER_STATUS_TIMESTAMP_BEGINint
USER_STATUS_TIMESTAMP_ENDint
USER_STATUS_ATTENTION_SCOREdouble
USER_STATUS_TIMESTAMPint
USER_STATUS_IS_BLINK_LEFTbool
USER_STATUS_IS_BLINK_RIGHTbool
USER_STATUS_IS_BLINKbool
USER_STATUS_LEFT_OPENNESSdouble
USER_STATUS_RIGHT_OPENNESSdouble
USER_STATUS_IS_DROWSINESSbool
USER_STATUS_DROWSINESS_INTENSITYdouble

Example

_seeso.getUserStatusEvent().listen((event) {
UserStatusInfo userStatusInfo = UserStatusInfo(event);
if (userStatusInfo.type == UserStatusEventType.ATTENTION) {
//todo attention event proccessed.
} else if (userStatusInfo.type == UserStatusEventType.BLINK) {
//todo blink event proccessed.
} else {
//todo drowsiness event proccessed.
}
});

OneEuroFilterManager

class OneEuroFilterManager

Manages a collection of OneEuroFilters for filtering multiple values.

Summary

Function
Constructor
filterValues
getFilteredValues

Constructor

  OneEuroFilterManager(
{required int count,
freq = _defaultFrequency,
minCutOff = _defaultMinCutOFF,
beta = _defaultBeta,
dCutOff = _defaultDCutOFF})

Use this constructor to initialize the filter and specify the number of values to filter and the filter's settings.

ParametersTypeDescription
countintThe number of values to filter. For example, if set to 2, it filters two input values separately.
freqdoubleRepresents the sampling frequency of the data. The default value is 30.0
minCutOffdoubleMinimum cutoff frequency used to filter noise in the data. The default value is 1.0
betadoubleIndicates the strength of applying the derivative filter. The default value is 0.007
dCutOffdoubleRepresents the cutoff frequency for the derivative data. The default value is 1.0

Example

 he method uses default values for freq, minCutOff, beta, and dCutOff.
OneEuroFilterManager _filterManager = OneEuroFilterManager(count: 2);

filterValues

bool filterValues(int timestamp, List<double> val)

Performs filtering for the given timestamp and a list of values.

Use this method to perform filtering on the given data and obtain the filtered results. If filtering fails or if there are invalid values, the filter is reset, and false is returned.

ParametersTypeDescription
timestampintRepresents the timestamp of the data and is used for filtering.
valList<double>A list of values to be filtered, representing the values for which you want to obtain filtered results.
Return TypeDescription
boolIf a value is invalid or anomalous, the filter is reset, and false is returned. If the filtering is successful, it returns true.

Example

GazeInfo gazeInfo = GazeInfo(event);
this.gazeInfo = gazeInfo;
if (_useFilter) {
bool isFiltered = _filterManager
.filterValues(gazeInfo.timestamp, [gazeInfo.x, gazeInfo.y]);
if (isFiltered) {
print("filtered success!");
}
}

getFilteredValues

List<double> getFilteredValues()

Retrieves the filtered values obtained after applying the filter.

This function returns a list of filtered double values that have been processed using the filter. It allows you to access the filtered results for further use.

Return TypeDescription
List<double>A list of filtered double values.

Example

bool isFiltered = _filterManager
.filterValues(gazeInfo.timestamp, [gazeInfo.x, gazeInfo.y]);
if (isFiltered) {
List<Double> filtered = _filterManager.getFilteredValues();
print("filtered (x ,y) : (${filtered[0]}, ${filtered[1]})");
}

InitializedResult

class InitializedResult

Represents the result of the SeeSo gaze tracker initialization.

Use this class to obtain the result of the initialization process after calling initGazeTracker.

See Authentication for more details.

Summary

VariableTypeDescription
resultboolThe result field indicates whether the initialization was successful.
messageStringThe message field provides additional information in case of failure. In case of a successful initialization, message will be "ERROR_NONE."
Function
Constructor

Constructor

InitializedResult(Map<dynamic, dynamic> resultMap)

Creates an instance of InitializedResult by parsing a result map.

The resultMap should contain the necessary keys and values for initializing the fields

Map<dynamic, dynamic> resultMap

Key (String)Value Type
INITIALIZED_RESULT_KEYString
PROINITIALIZED_RESULT_MESSAGE_KEYGRESSString
note

It is recommended that developers do not create this themselves.


CameraPosition

class CameraPosition

This class represents the camera position for Android.

note

This class is intended to be used on Android platform only.

Summary

VariableTypeDescription
modelNameStringThe model name of the mobile device.
screenWidthdoubleThe width of the screen in pixels.
screenHeightdoubleThe height of the screen in pixels.
screenOriginXdoubleThe distance in millimeters from the front camera to the screen origin (0, 0).
screenOriginYdoubleThe distance in millimeters from the front camera to the screen origin (0, 0).
cameraOnLongerAxisboolIndicates whether the camera is mounted on the longer axis of the device.
Function
Constructor

Constructor

CameraPosition({
required this.modelName,
required this.screenWidth,
required this.screenHeight,
required this.screenOriginX,
required this.screenOriginY,
this.cameraOnLongerAxis = false,
})

Creates a CameraPosition instance with the provided parameters.

ParametersTypeDescription
modelNameStringThe modelName should be the model name of the mobile device.
screenWidthdoubleThe screenWidth represent the dimensions of the screen in pixels.
screenHeightdoubleThe screenHeight represent the dimensions of the screen in pixels.
screenOriginXdoubleThe screenOriginX are distances in millimeters from the front camera to the screen origin (0, 0).
screenOriginYdoubleThe screenOriginY are distances in millimeters from the front camera to the screen origin (0, 0).
cameraOnLongerAxisboolcameraOnLongerAxis indicates whether the camera is mounted on the longer axis of the device (default is false).

Example


/// This is information about the Galaxy Fold 5 when it is folded.
CameraPosition cameraPosition = CameraPosition(
modelName: "SM-F946N",
screenWidth: 904,
screenHeight: 2316,
screenOriginX: -28.5,
screenOriginY: 5);

CalibrationMode

enum CalibrationMode 

An enumeration representing the calibration modes for calibration processes.

MembersDescription
ONERepresents a calibration mode with one target point.
FIVERepresents a calibration mode with five target points. It provides higher accuracy compared to the ONE mode.
SIXRepresents a calibration mode with six target points.
It offers even higher accuracy and precision, suitable for demanding calibration requirements.

CalibrationCriteria

enum CalibrationCriteria

An enum representing different calibration criteria or levels.

The CalibrationCriteria enum is used to define various calibration settings or criteria that can be applied during the calibration process.

MembersDescription
DEFAULTDefault calibration setting level suitable for general users.
HIGHHigh calibration setting level suitable for users requiring precise or high-accuracy calibration.
LOWLow calibration setting level suitable for users looking to complete calibration quickly with lower accuracy.

TrackingState

enum TrackingState

Enum representing different states of gaze tracking.

MembersDescription
SUCCESSGaze tracking was successful without any issues.
LOW_CONFIDENCEGaze tracking was successful but with low confidence level.
UNSUPPORTEDDenotes an unsupported tracking state, where the face is detected but the current settings result in an unexpected tracking state that cannot be accommodated.
FACE_MISSINGGaze tracking failed because the face was not detected.

ScreenState

enum ScreenState

An enumeration representing different states of gaze position in relation to the device screen.

MembersDescription
INSIDE_OF_SCREENRepresents a state where the gaze position is inside the device screen.
OUTSIDE_OF_SCREENIndicates a state where the gaze position is outside the device screen.
UNKNOWNDenotes an unknown state of gaze position, typically occurring when gaze tracking is not accurate.

EyeMovementState

enum EyeMovementState

An enumeration representing different types of eye movement states.

MembersDescription
FIXATIONRepresents a state where the eye movement is a fixation, indicating a stable gaze position.
SACCADEIndicates a state where the eye movement is a saccade, indicating a rapid shift in gaze position.
UNKNOWNDenotes an unknown eye movement state, typically occurring when gaze tracking is not accurate.

StatusType

enum StatusType

An enumeration representing different types of status events for gaze tracking.

MembersDescription
STARTIndicates that gaze tracking has started.
STOPIndicates that gaze tracking has stopped.

StatusErrorType

enum StatusErrorType

An enumeration representing different types of error scenarios when the gaze tracking status stops.

MembersDescription
ERROR_NONEGazeTracker.stopTracking call succeeded without any errors.
ERROR_CAMERA_STARTError code occurs when GazeTracker.startTracking is called, but the front camera of the device is not available.
ERROR_CAMERA_INTERRUPTError code occurs when the camera becomes unavailable, interrupting gaze tracking.

CalibrationType

enum CalibrationType

An enumeration representing the different stages within a calibration process.

MembersDescription
CALIBRATION_PROGRESSIndicates an event providing updates on the progress of the ongoing calibration target.
CALIBRATION_NEXT_XYProvides information regarding the XY coordinates of the upcoming calibration target.
CALIBRATION_FINISHEDMarks the successful completion of the entire calibration process.

UserStatusEventType

enum UserStatusEventType

An enumeration representing different types of user status events that can be tracked.

MembersDescription
ATTENTIONIndicates that the tracker is configured to detect user's attention.
BLINKIndicates that the tracker is configured to detect user's blinking.
DROWSINESSIndicates that the tracker is configured to detect user's drowsiness.

SeeSoOrientation

enum SeeSoOrientation

An enumeration representing different types of gaze events orientation that can be tracked.

events that can be tracked, especially on the iOS platform. It is primarily used for the purpose of forcibly changing the direction of gaze coordinates.

MembersDescription
PORTRAITThe device is in portrait mode, with the device upright and the Home button on the bottom.
PORTRAIT_UPSIDE_DOWNThe device is in portrait mode but is upside down, with the device upright and the Home button at the top.
LANDSCAPE_LEFTThe device is in landscape mode, with the device upright and the Home button on the left.
LANDSCAPE_RIGHTThe device is in landscape mode, with the device upright and the Home button on the right.